﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using OSharp.AspNetCore.Mvc;
using wyxuan.yoyu.Web.Pack;

namespace wyxuan.yoyu.Web.Controllers
{


   
    public class TestChatHubController : ApiController
    {

        private readonly IHubContext<IMChatHub> _hub;


        public TestChatHubController(IHubContext<IMChatHub> hub)
        {
            _hub = hub;
        }

        [HttpGet]
        [Description("测试一下Chathub")]
        public Task SendMessage(string msg)
        {
          return  _hub.Clients.All.SendAsync("SendMessageTest", msg);
        }

    }
}